<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>添加同父节点</title>
</head>
<script type="text/javascript">
    function cloneAndCopy(nodeId,deep) {
        var toClone = document.getElementById(nodeId);
        var clonedNode = toClone.cloneNode(deep);
        var insertPoint = document.getElementById("inserthere");
        insertPoint.appendChild(clonedNode);
    }
</script>
<body>
    <p id = p1>Please<em> go to </em>DOM World</p>
    <hr>
    <div id = "inserthere" style="background-color: blue"></div>
    <hr>
<form action="#" method="get">
    <input type="button" value="copy" onclick="cloneAndCopy('p1',false);">
    <input type="button" value="copyDeep" onclick="cloneAndCopy('p1',true);">

</form>
</body>
</html>